-
Notifications
You must be signed in to change notification settings - Fork 349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use ternary operator for conditional assignments #394
Conversation
(isTimestamp(field) && (options.useDate === DateOption.DATE || options.useDate === DateOption.STRING)) || | ||
isValueType(ctx, field) | ||
) { | ||
} else if (readSnippet(`x`).toCodeString() == 'x') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This somehwat unrelated change (first commit) is worth having a 👀. It did not change the code output at all which I guess means it is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, that's a neat way of doing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
(isTimestamp(field) && (options.useDate === DateOption.DATE || options.useDate === DateOption.STRING)) || | ||
isValueType(ctx, field) | ||
) { | ||
} else if (readSnippet(`x`).toCodeString() == 'x') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yeah, that's a neat way of doing this.
Thanks! |
# [1.87.0](v1.86.0...v1.87.0) (2021-11-16) ### Features * Use ternary operator for conditional assignments ([#394](#394)) ([d84c084](d84c084))
🎉 This PR is included in version 1.87.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
That's the second step initially proposed in #371. In cases where the input value needs to be transformed, we cannot use nullish coalescing or anything new and fancy.
This improves the code output in two ways: